<script setup>
import SnackBar from "@/components/SnackBar.vue";

const props = defineProps(["error"]);

function errorToString(ex) {
  if (typeof ex == "string") {
    return ex;
  } else {
    return "请求错误";
  }
}
</script>

<template>
  <SnackBar :close="true" :show="!!error">{{ errorToString(error) }}</SnackBar>
</template>